/*
 * @Description: 对话框 带 关闭按钮
 * @Author: iamsmiling
 * @Date: 2021-06-09 22:29:50
 * @LastEditTime: 2021-06-16 08:10:45
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:flutter/material.dart';

class DialogWrapper extends StatelessWidget {
  final WidgetBuilder builder;
  const DialogWrapper({Key? key, required this.builder}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Dialog(
      child: Stack(
        children: [
          Column(
            mainAxisSize: MainAxisSize.min,
            children: [Builder(builder: builder)],
          ),
          Positioned(
              right: 0,
              child: GestureDetector(
                  onTap: Navigator.of(context).pop,
                  child: Container(
                      child: Transform.translate(
                    offset: Offset(R.dimen.dp16, -R.dimen.dp15),
                    child: Image.asset(R.image.closeDialog),
                  ))))
        ],
      ),
    );
  }
}
